/*
 * File:   RandomDrawingStrategy.h
 * Author: root
 *
 * Created on November 18, 2008, 2:55 PM
 */

#include "DrawingStrategy.h"

#ifndef _RANDOMDRAWINGSTRATEGY_H
#define	_RANDOMDRAWINGSTRATEGY_H

class RandomDrawingStrategy : public DrawingStrategy {
    
    int pickFromDiscardProbability;

protected:
    virtual void setExecutionParameter(int index, int rangeFraction) {
        // The execution parameter is the probability of drawing from the discard pile
        pickFromDiscardProbability = rangeFraction;
    }

public:
    
    RandomDrawingStrategy() 
    : DrawingStrategy(string("RandomDrawingStrategy"), 1), pickFromDiscardProbability(0) {}
    
    RandomDrawingStrategy(int myWeight)
    : DrawingStrategy(myWeight), pickFromDiscardProbability(0)
    {
    }
                
    virtual int getDecisionCertainty() {
        return 50;  // The agent has a one in two chance of picking the theoretical best card
    }

    virtual Strategy* getActiveInstance(int inst_weight) {
        return dynamic_cast<Strategy*>(new RandomDrawingStrategy(inst_weight));
    }
    
    virtual void opponentMove(int opponent, const Move& move) {}
    virtual bool pickFromDiscard(CCardStack*, const GameState*);

};

#endif	/* _RANDOMDRAWINGSTRATEGY_H */

